// ==========================================================================
// GFast自动生成controller操作代码。
// 生成日期：2024-11-15 16:58:05
// 生成路径: internal/app/system/controller/withdraw_records.go
// 生成人：周
// desc:余额提现记录
// company:云南奇讯科技有限公司
// ==========================================================================

package controller

import (
	"context"

	"github.com/tiger1103/gfast/v3/api/v1/system"
	"github.com/tiger1103/gfast/v3/internal/app/system/service"
)

type withdrawRecordsController struct {
	BaseController
}

var WithdrawRecords = new(withdrawRecordsController)

// List 列表
func (c *withdrawRecordsController) List(ctx context.Context, req *system.WithdrawRecordsSearchReq) (res *system.WithdrawRecordsSearchRes, err error) {
	res = new(system.WithdrawRecordsSearchRes)
	res.WithdrawRecordsSearchRes, err = service.WithdrawRecords().List(ctx, &req.WithdrawRecordsSearchReq)
	return
}

// Get 获取余额提现记录
func (c *withdrawRecordsController) Get(ctx context.Context, req *system.WithdrawRecordsGetReq) (res *system.WithdrawRecordsGetRes, err error) {
	res = new(system.WithdrawRecordsGetRes)
	res.WithdrawRecordsInfoRes, err = service.WithdrawRecords().GetById(ctx, req.Id)
	return
}

// Add 添加余额提现记录
func (c *withdrawRecordsController) Add(ctx context.Context, req *system.WithdrawRecordsAddReq) (res *system.WithdrawRecordsAddRes, err error) {
	err = service.WithdrawRecords().Add(ctx, req.WithdrawRecordsAddReq)
	return
}

// Edit 修改余额提现记录
func (c *withdrawRecordsController) Edit(ctx context.Context, req *system.WithdrawRecordsEditReq) (res *system.WithdrawRecordsEditRes, err error) {
	err = service.WithdrawRecords().Edit(ctx, req.WithdrawRecordsEditReq)
	return
}

// Delete 删除余额提现记录
func (c *withdrawRecordsController) Delete(ctx context.Context, req *system.WithdrawRecordsDeleteReq) (res *system.WithdrawRecordsDeleteRes, err error) {
	err = service.WithdrawRecords().Delete(ctx, req.Ids)
	return
}
